<?php
return array(
    'runHandlers'=>array(
        '@' => array(
            'handler'=>'RedirectOnDataHandler',
            'params'=>array(
                'onFalse'=>'@authUser',
                'url'=>'/login/'
            ),
        ),
        'userCanModify' => array(
            'handler'=>'user/CheckUserRoles',
            'params'=>array(
                'user'=>'@authUser',
                'requiredRoles'=>array(1), //Директор
            ),
        ),
        'saveUser' => array(
            'handler'=>'user/SetUserOrganization',
            'params'=>array(
                'action'=>$_POST['action'],
                'userId'=>$_POST['add_user_id'],
                'organizationId'=>$_POST['add_user_organization_id'],
            ),
        ),
        'editOrganization' => array(
            'handler'=>'organization/EditOrganizationHandler',
            'params'=>array(
                'action'=>$_POST['action'],
                'companyObj'=>'@userCompany',
                'organizationId'=>$_POST['edit_organization_id'],
                'orgName'=>$_POST['edit_organization_name'],
                'orgParentId'=>$_POST['edit_organization_parent_id'],
                'orgDescription'=>$_POST['edit_organization_description'],
                'orgHeadUserId'=>$_POST['edit_organization_head_user_id'],
            ),
        ),
        'organization' => array(
            'handler'=>'organization/GetCompanyOrganization',
            'params'=>array(
                'companyObj'=>'@userCompany',
            ),
        ),
        'companyUsers' => array(
            'handler'=>'user/GetCompanyUsers',
            'params'=>array(
                'companyObj'=>'@userCompany',
            ),
        ),
    ),
);    